package com.next

class Employee
{
    String fullName
    String cellphone
    String gender
    Date birthday
    String idNumber

    Employee manager

    String externalId

    Company company

    User createBy
    User modifyBy

    User user

    Date createdDate = new Date()
    Date modifiedDate = new Date()

    static hasMany = [positions: EmployeePosition]

    static constraints = {
        fullName maxSize: 64
        cellphone maxSize: 32
        gender inList: ['男', '女'], blank: true, nullable: true
        birthday blank: true, nullable: true
        externalId blank: true, nullable: true
    }

    String toString()
    {
        fullName
    }

    def beforeUpdate()
    {
        modifiedDate = new Date()
    }
}
